package com.geo.geoProject.client.tousLesProgrammes.carte2d;

import com.geo.geoProject.client.UI.docks.Icone;
import com.geo.geoProject.client.application.ListeDesApplications;
import com.geo.geoProject.client.application.MessageInterProgramme;
import com.geo.geoProject.client.application.Programme;
import com.google.gwt.user.client.ui.Widget;

public class Carte2d  extends Programme  {

	private Carte2dPanel c;
	
	public static int MSG_TYPE_ZOOMPLUS  = 0 ;
	public static int MSG_TYPE_ZOOMMOINS = 1 ;

	@Override
	public Widget getInitWidget() {
		c = new Carte2dPanel() ;
		return c;
	}

	@Override
	public Icone getIcone() {
		return null;
	}

	@Override
	public void recoitMessage(MessageInterProgramme m) {
		if (m.idMsgType==MSG_TYPE_ZOOMPLUS) {
			c.map.setZoomLevel(c.map.getZoomLevel()+1) ;
		}
		if (m.idMsgType==MSG_TYPE_ZOOMMOINS) {
			c.map.setZoomLevel(c.map.getZoomLevel()-1) ;
		}
	}

	@Override
	public void resizeAppWindow(int w, int h) {
		if (c.map!=null) {
			c.map.setSize((w-10)+"px", (h-45)+"px") ;
		}
	}
	
	@Override
	public ConfigurationFenetre getConfigurationApparance() {
		ConfigurationFenetre c = new ConfigurationFenetre() ;
		c.ShowFooter = true ;
		return c;
	}

	@Override
	public String getTitreApplication() {
		return "Carte";
	}

	@Override
	public void minimise() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void maximise() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public ListeDesApplications getPid() {
		return ListeDesApplications.Carte2d ;
	}

	@Override
	public void moved(int top, int left) {
		// TODO Auto-generated method stub
		
	}

}
